#@embedLayout()


#define content()

<form id="vendorFormId" method="post">
    <input type="hidden" name="vendor.ven_id" id="venId" value="#(vendor.venId??)">
    <table class="table table-bordered">
        <tr>
            <td style="padding-top:15px;">厂商名称:</td>
            <td><input type="text" id="vendorName" name="vendor.vendor_name" class="easyui-textbox"
                       data-options="required:true,validType:{length:[1,128]}"
                       value="#(vendor.vendor_name??)"
                #if(vendor != null) readonly="readonly" #end >
            </td>
        </tr>
        <tr>
            <td>厂商别名:</td>
            <td><input type="text" class="easyui-textbox" id="vendorAlias" name="vendor.vendor_alias"
                       data-options="required:true,validType:{length:[1,128]}"
                       value="#(vendor.vendor_alias??)">
            </td>
        </tr>
    </table>
</form>

#end


#define css()


#end


#define js()

<script type="text/javascript">
    function vendor_datagrid_save(opr_type) {
        var url = '';
        if (opr_type === 'add') {
            url = contextRootPath + '/equipment/vendorSave';
        } else {
            url = contextRootPath + '/equipment/vendorUpdate';
        }

        $('#vendorFormId').form('submit', {
            url: url,
            onSubmit: function () {
                var flag = $(this).form('enableValidation').form('validate');
                if (flag) {
                    showProcess(true, '温馨提示', '正在提交数据...');
                }
                return flag;
            },
            success: function (data) {
                showProcess(false);
                var params = {};
                params.element = vendorDatagridId;
                params.data = data;
                params.dlgId = "vendor_crud_dlg";
                resultCallback(params);
            },
            onLoadError: function () {
                showProcess(false);
                $.messager.alert('温馨提示', '由于网络或服务器太忙，提交失败，请重试！');
            }
        });
    }

</script>

#end


